#ifndef INGREDIENT_H_
#define INGREDIENT_H_

#include <iostream>
using namespace std;


struct Ingredient {
public:
        // constructors
        Ingredient();
        
        Ingredient (int i, int r, float a, string u, string n) {                //FPW, A1
                ingredient_id = i;                                                                                      //FPW, A1
                recipe_id = r;                                                                                          //FPW, A1
                amt = a;                                                                                                        //FPW, A1
                units = u;                                                                                                      //FPW, A1
                name = n;                                                                                                       //FPW, A1
        }
        
   // utility functions
        string display() const;
        void displaym() const { //FPW, A1
                cout << ingredient_id << " " << recipe_id << " " << amt << " " << units << " " << name << endl; //FPW, A1
        }
        
        /* The following utility functions were written by Fransiska Putri Wina, solving problem B1a */
	int get_recipe_id () const {
		return recipe_id;
	}
	int get_ingredient_id () const {
		return ingredient_id;
	}
    /* The following utility functions were written by Fransiska Putri Wina, solving problem D.1 - recipes & ingredients */
	float get_amount () const {
		return amt;
	}
	string get_unit () const {
		return units;
	}
	string get_name () const {
		return name;
	}
	/* End of code by FPW - D.1 */
	void displayaun () const {
		cout << amt << " " << units << " " << name << endl; 
	}
	/* End of code by FPW - B1a */
        
	//MGM D3: override the operator < to sort the ingredient based on ingredient ID
	bool operator < (const Ingredient& i) const
	{
		return (ingredient_id < i.ingredient_id);
	}
	
private:
   //constants  

   // private data
        int ingredient_id;
        int recipe_id;
        float amt;
        string units;
        string name;
};


#endif //INGREDIENT_H_
